package com.xyy.saas.payment.callback.core.handler;

import com.xyy.saas.payment.adpater.jd.common.JDConstants;
import com.xyy.saas.payment.adpater.jd.service.JDAdpaterService;
import com.xyy.saas.payment.adpater.jdCredit.req.RepayResultNotifyReq;
import com.xyy.saas.payment.adpater.jdCredit.service.JdCreditService;
import com.xyy.saas.payment.cores.bo.jd.JDMerchantOneKeySignResultDto;
import com.xyy.saas.payment.util.JSONUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 京东融资还款结果通知
 */
@Component
@Slf4j
public class JdCreditRepayResultNotifyHandler implements BaseHandler {
    @Autowired
    private JdCreditService jdCreditService;

    @Override
    public String getMethod() {
        //return JDConstants.CALLBACK_CONTRACT_METHOD_PREFIX;
        return "";
    }

    @Override
    public boolean callBackHandler(Object domain) {
        log.info("JDContractHandler#callBackHandler domain={}", JSONUtils.toJSON(domain));
        RepayResultNotifyReq repayResultNotifyReq = (RepayResultNotifyReq) domain;
//        if (!JDConstants.SUCCESS_CODE_CARBIN.equals(jdMerchantOneKeySignResultDto.getCode())) {
//            log.info("京东签约结果回调code失败，将签约状态置为失败 {}", jdMerchantOneKeySignResultDto);
//            jdMerchantOneKeySignResultDto.setSignStatus("F");
//        }
//        jdAdpaterService.dealOneKeySignResult(jdMerchantOneKeySignResultDto);
        return true;
    }

}
